#include <stdio.h>

int main()
{
    //插入排序
    int a[10] = {5, 3, 8, 6, 2, 7, 1, 9, 4, 0};
    int i, j, temp;
    for (i = 1; i < 10; i++) {
        temp = a[i];
        j = i - 1;
        while (j >= 0 && a[j] > temp) {
            a[j + 1] = a[j];
            j--;
        }
        a[j + 1] = temp;
    }
    //输出排序后的数组
    for (i = 0; i < 10; i++) {
        printf("%d ", a[i]);
    }
    printf("\n");
    return 0;
}
